﻿using Entity.Core;
using FreeSql.DataAnnotations;
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Data;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Entity.Core.Config
{
    /// <summary>
    /// 属性模式配置 参数
    /// </summary>
    [JsonObject(MemberSerialization.OptIn), Table(Name = "property_pattern_config_param", DisableSyncStructure = true)]
    public class PropertyPatternConfigParamEntity:CommonBaseEntity
    {
        #region 上级参数雪花Id

        /// <summary>
        /// 上级参数雪花Id
        /// <para>数据库字段信息：parent_sid ,  bigint ; </para>
        /// </summary>
        [JsonProperty("parent_sid)", Order = 1)]
        [Column(Name = "parent_sid", DbType = "bigint")]
        [Display(Name = "上级参数雪花Id")]
        public long? @ParentSid { get; set; }

        #endregion 上级参数雪花Id

        #region 配置外键 etl_lib_sys_config.sid

        /// <summary>
        /// 配置外键
        /// <para>数据库类型：bigint ; 数据库值：不允许为空</para>
        /// <para>etl_lib_sys_config.sid</para>
        /// <para>数据库字段信息：fk_config_sid ,  bigint ; </para>
        /// </summary>
        [JsonProperty("fk_config_sid)", Order = 2)]
        [Column(Name = "fk_config_sid", DbType = "bigint")]
        [Display(Name = "配置外键")]
        public long? @FkConfigSid { get; set; }

        #endregion 配置外键 etl_lib_sys_config.sid

        #region 参数层级

        /// <summary>
        /// 参数层级
        /// <para>数据库字段信息：param_level ,  int ; </para>
        /// </summary>
        [JsonProperty("param_level)", Order = 3)]
        [Column(Name = "param_level", DbType = "int")]
        [Display(Name = "参数层级")]
        public int? @ParamLevel { get; set; }

        #endregion 参数层级

        #region 参数分组键

        /// <summary>
        /// 参数分组键
        /// <para>数据库字段信息：group_key ,  varchar(256) ; </para>
        /// </summary>
        [JsonProperty("group_key)", Order = 4)]
        [Column(Name = "group_key", DbType = "varchar(256)")]
        [Display(Name = "参数分组键")]
        public string? @GroupKey { get; set; }

        #endregion 参数分组键

        #region 参数分组名称

        /// <summary>
        /// 参数分组名称
        /// <para>数据库字段信息：group_name ,  varchar(90) ; </para>
        /// </summary>
        [JsonProperty("group_name)", Order = 5)]
        [Column(Name = "group_name", DbType = "varchar(90)")]
        [Display(Name = "参数分组名称")]
        public string? @GroupName { get; set; }

        #endregion 参数分组名称

        #region 参数类型 加载参数的实体类类型

        /// <summary>
        /// 参数类型
        /// <para>数据库类型：varchar(256)</para>
        /// <para>加载参数的实体类类型</para>
        /// <para>数据库字段信息：para_type ,  varchar(256) ; </para>
        /// </summary>
        [JsonProperty("param_type)", Order = 6)]
        [Column(Name = "param_type", DbType = "varchar(256)")]
        [Display(Name = "参数类型")]
        public string? ParamType { get; set; }

        #endregion 参数类型 加载参数的实体类类型

        #region 参数键 用于反射确定参数属性

        /// <summary>
        /// 参数键
        /// <para>数据库类型：varchar(256) ; 数据库值：不允许为空</para>
        /// <para>用于反射确定参数属性</para>
        /// <para>数据库字段信息：param_key ,  varchar(256) ; </para>
        /// </summary>
        [JsonProperty("param_key)", Order = 7)]
        [Column(Name = "param_key", DbType = "varchar(256)")]
        [Display(Name = "参数键")]
        public string? @ParamKey { get; set; }

        #endregion 参数键 用于反射确定参数属性

        #region 参数名

        /// <summary>
        /// 参数名
        /// <para>数据库字段信息：param_name ,  varchar(90) ; </para>
        /// </summary>
        [JsonProperty("param_name)", Order = 8)]
        [Column(Name = "param_name", DbType = "varchar(90)")]
        [Display(Name = "参数名")]
        public string? @ParamName { get; set; }

        #endregion 参数名

        #region 参数值

        /// <summary>
        /// 参数值
        /// <para>数据库字段信息：param_value ,  varchar(256) ; </para>
        /// </summary>
        [JsonProperty("param_value)", Order = 8)]
        [Column(Name = "param_value", DbType = "varchar(256)")]
        [Display(Name = "参数值")]
        public string? @ParamValue { get; set; }

        #endregion 参数值

        #region 参数说明

        /// <summary>
        /// 参数说明
        /// <para>数据库字段信息：param_description ,  varchar(900) ; </para>
        /// </summary>
        [JsonProperty("param_description)", Order = 9)]
        [Column(Name = "param_description", DbType = "varchar(900)")]
        [Display(Name = "参数说明")]
        public string? @ParamDescription { get; set; }

        #endregion 参数说明

        #region 是否显示 0:否;1:是

        /// <summary>
        /// 是否显示
        /// <para>数据库类型：tinyint ; 数据库默认值：1</para>
        /// <para>0:否;1:是</para>
        /// <para>数据库字段信息：is_visible ,  tinyint ; </para>
        /// </summary>
        [JsonProperty("is_visible)", Order = 10)]
        [Column(Name = "is_visible", DbType = "tinyint")]
        [Display(Name = "是否显示")]
        public bool? @IsVisible { get; set; } = true;

        #endregion 是否显示 0:否;1:是

    }
}
